//
//  ZFDQKViewController.m
//  HappilyLoan
//
//  Created by zainishenbian on 2017/4/14.
//  Copyright © 2017年 zongqingxiangqian. All rights reserved.
//

#import "ZFDQKViewController.h"
#import "ZFHeader.h"

@interface ZFDQKViewController ()
{
    WKWebView *webV;
}
@end

@implementation ZFDQKViewController

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    [MobClick beginLogPageView:@"ZFDQKView"];
    [webV loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:_DQKUrl]]];
    self.navigationController.navigationBarHidden = NO;
}
- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];
    [MobClick endLogPageView:@"ZFDQKView"];
}
- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.navigationItem.title = @"贷款超市";
    webV = [[WKWebView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];
    [self.view addSubview:webV];
    
    
}

#pragma mark ———— 返回
- (BOOL)navigationShouldPopOnBackButton
{
    if (webV.canGoBack) {
        
        [webV goBack];
        return NO;
    }
    
    [self.navigationController popToRootViewControllerAnimated:YES];
    AppDelegate *delegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
    if (delegate.isFirstEnterApp == YES) {
        
        delegate.isFirstEnterApp = NO;
    }
    return NO;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
